package My::Test::Class;
use warnings;
use strict;

use Test::Most;
use base qw(Test::Class Class::Data::Inheritable);

BEGIN {
    __PACKAGE__->mk_classdata('class');
}

sub startup : Tests( startup => 1) {
    my $test = shift;
    ( my $class = ref $test ) =~ s/^Test:://;
    return ok 1, "$class loaded" if $class eq __PACKAGE__;
    use_ok $class or die;
    $test->class($class);
}

INIT {
    Test::Class->runtests;
}

sub build_test_object {
    my $test  = shift;
    my $class = $test->class;

    my $obj;
    if ($test->can('_init_test_obj')) {
	$obj = $test->_init_test_obj;
    }
    else {
	$obj = $class->new;
    }
}

1;
